﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.SharePoint;

namespace ProjectItemDefinition
{
    [Export(typeof(ISharePointProjectExtension))]
    public class SPProjectExtension:ISharePointProjectExtension
    {
        public void Initialize(ISharePointProjectService projectService)
        {
            projectService.ProjectPropertiesRequested += new EventHandler<SharePointProjectPropertiesRequestedEventArgs>(ProjectServiceProjectPropertiesRequested);
        }

        static void ProjectServiceProjectPropertiesRequested(object sender, SharePointProjectPropertiesRequestedEventArgs e)
        {
            e.PropertySources.Add((object)new TokenReplacementFileExtensions());
        }
    }
    public class TokenReplacementFileExtensions
    {
        [DisplayName("Service Token for WCF")]
        [DescriptionAttribute("This value ensure token in wcf file is replaced.")]
        public string Extension
        {
            get
            {
                return "svc";
            }
        }
    }
}
